#ifndef _VIDEO_H
#define _VIDEO_H

#define 	COLS	80
#define	ROWS	25
#define	NUM_VC	6

// write one character to the screen
void putch(char c);

// clear the screen
void cls();

// write a string to the screen
void puts(char *c);

char getch();

// get the cursor position
void get_cursor(int*, int*);

// set output colors
void settextcolor(unsigned char forecolor, unsigned char backcolor);

// initialize video driver
void initVideo(void);

// switch virtual console
void switchConsole(unsigned);

// move cursor around and around
void move_up();
void move_down();
void move_left();
void move_right();

// structs
// a vector in memory
struct _vector_t
{
	unsigned access_byte;
	unsigned eip;
};
typedef struct _vector_t vector_t;

// a circular buffer
struct _queue_t
{
	unsigned char *data;
	unsigned size;
	unsigned in_base;
	unsigned in_ptr;
	unsigned out_ptr;
};
typedef struct _queue_t queue_t;

// a virtual console
struct _console_t
{
	queue_t keystrokes;
	unsigned esc, attrib, csr_x, csr_y, esc1, esc2, esc3;
	unsigned short *fb_adr;
};
typedef struct _console_t console_t;

console_t vcs[NUM_VC];
console_t *curr_vc;

#endif
